.class public Lcom/estrongs/android/util/p0;
.super Ljava/lang/Object;
.source "ViewUtil.java"


# direct methods
.method public static a(Landroid/content/Context;Landroid/graphics/drawable/Drawable;I)Landroid/graphics/drawable/Drawable;
    .locals 1

    .line 2
    :try_start_0
    invoke-virtual {p1}, Landroid/graphics/drawable/Drawable;->getConstantState()Landroid/graphics/drawable/Drawable$ConstantState;

    move-result-object p0

    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable$ConstantState;->newDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object p0

    .line 3
    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->mutate()Landroid/graphics/drawable/Drawable;

    move-result-object p0

    .line 4
    invoke-static {p0}, Landroidx/core/graphics/drawable/DrawableCompat;->wrap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;

    move-result-object p0

    .line 5
    invoke-static {}, Lcom/estrongs/android/ui/theme/b;->r()Lcom/estrongs/android/ui/theme/b;

    move-result-object v0

    invoke-virtual {v0, p2}, Lcom/estrongs/android/ui/theme/b;->a(I)I

    move-result p2

    invoke-static {p0, p2}, Landroidx/core/graphics/drawable/DrawableCompat;->setTint(Landroid/graphics/drawable/Drawable;I)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    return-object p0

    :catch_0
    return-object p1
.end method

.method public static a(Landroid/view/View;I)Landroid/view/View;
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Landroid/view/View;",
            ">(",
            "Landroid/view/View;",
            "I)TT;"
        }
    .end annotation

    .line 1
    invoke-virtual {p0, p1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p0

    return-object p0
.end method

.method public static a(Landroid/app/Activity;Landroid/view/MenuItem;I)V
    .locals 3

    const/4 v0, -0x1

    if-eq p2, v0, :cond_0

    .line 6
    invoke-virtual {p0}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0, p2}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object p2

    goto :goto_0

    :cond_0
    const/4 p2, 0x0

    :goto_0
    const/4 v0, 0x0

    if-nez p2, :cond_1

    .line 7
    new-instance p2, Landroid/graphics/drawable/ColorDrawable;

    invoke-direct {p2, v0}, Landroid/graphics/drawable/ColorDrawable;-><init>(I)V

    .line 8
    invoke-virtual {p0}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object p0

    const v1, 0x7f0700a2

    invoke-virtual {p0, v1}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result p0

    .line 9
    invoke-virtual {p2, v0, v0, p0, p0}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 10
    invoke-interface {p1, p2}, Landroid/view/MenuItem;->setIcon(Landroid/graphics/drawable/Drawable;)Landroid/view/MenuItem;

    goto :goto_1

    .line 11
    :cond_1
    invoke-virtual {p0}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f0700c6

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result v1

    .line 12
    invoke-virtual {p2, v0, v0, v1, v1}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    const v0, 0x7f0602dd

    .line 13
    invoke-static {p0, p2, v0}, Lcom/estrongs/android/util/p0;->a(Landroid/content/Context;Landroid/graphics/drawable/Drawable;I)Landroid/graphics/drawable/Drawable;

    move-result-object p0

    invoke-interface {p1, p0}, Landroid/view/MenuItem;->setIcon(Landroid/graphics/drawable/Drawable;)Landroid/view/MenuItem;

    :goto_1
    return-void
.end method

.method public static a(Landroid/app/Activity;Landroid/widget/TextView;Landroid/widget/ImageView;Ljava/lang/String;)V
    .locals 10

    .line 14
    new-instance v0, Ljava/text/DecimalFormat;

    const-string v1, "#.##"

    invoke-direct {v0, v1}, Ljava/text/DecimalFormat;-><init>(Ljava/lang/String;)V

    .line 15
    invoke-static {p3}, Lcom/estrongs/android/util/h0;->t2(Ljava/lang/String;)Z

    move-result v1

    const/4 v2, 0x1

    const-wide/16 v3, 0x0

    const/4 v5, 0x2

    const/4 v6, 0x0

    if-eqz v1, :cond_0

    new-array v1, v5, [J

    .line 16
    fill-array-data v1, :array_0

    .line 17
    :try_start_0
    invoke-static {p3}, Lcom/estrongs/fs/impl/usb/e;->i(Ljava/lang/String;)[J

    move-result-object v1
    :try_end_0
    .catch Lcom/estrongs/fs/impl/usb/UsbFsException; {:try_start_0 .. :try_end_0} :catch_0

    .line 18
    :catch_0
    aget-wide v5, v1, v6

    add-long/2addr v5, v3

    .line 19
    aget-wide v7, v1, v2

    sub-long v1, v5, v7

    add-long/2addr v1, v3

    goto :goto_0

    .line 20
    :cond_0
    invoke-static {p3}, Lcom/estrongs/fs/util/f;->h(Ljava/lang/String;)[J

    move-result-object p3

    .line 21
    aget-wide v7, p3, v6

    aget-wide v1, p3, v2

    sub-long/2addr v7, v1

    aget-wide v1, p3, v5

    mul-long v7, v7, v1

    add-long v1, v7, v3

    .line 22
    aget-wide v6, p3, v6

    aget-wide v8, p3, v5

    mul-long v6, v6, v8

    add-long/2addr v3, v6

    move-wide v5, v3

    :goto_0
    const/high16 p3, 0x3f800000    # 1.0f

    long-to-float v1, v1

    mul-float v1, v1, p3

    long-to-float p3, v5

    div-float/2addr v1, p3

    const/high16 p3, 0x42c80000    # 100.0f

    mul-float v1, v1, p3

    .line 23
    new-instance p3, Ljava/lang/StringBuffer;

    invoke-direct {p3}, Ljava/lang/StringBuffer;-><init>()V

    .line 24
    invoke-static {v1}, Ljava/lang/Math;->round(F)I

    move-result v2

    const/4 v3, 0x0

    cmpl-float v3, v1, v3

    if-lez v3, :cond_1

    const v3, 0x3c23d70a    # 0.01f

    cmpg-float v4, v1, v3

    if-gtz v4, :cond_1

    .line 25
    invoke-virtual {p3, v3}, Ljava/lang/StringBuffer;->append(F)Ljava/lang/StringBuffer;

    goto :goto_2

    :cond_1
    const/high16 v3, 0x41200000    # 10.0f

    cmpl-float v3, v1, v3

    if-lez v3, :cond_2

    .line 26
    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    goto :goto_1

    :cond_2
    float-to-double v3, v1

    invoke-virtual {v0, v3, v4}, Ljava/text/DecimalFormat;->format(D)Ljava/lang/String;

    move-result-object v0

    :goto_1
    invoke-virtual {p3, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/Object;)Ljava/lang/StringBuffer;

    :goto_2
    const/16 v0, 0x46

    const v1, 0x7f080973

    if-lt v2, v0, :cond_3

    .line 27
    invoke-virtual {p0}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object p0

    const v0, 0x7f060101

    invoke-virtual {p0, v0}, Landroid/content/res/Resources;->getColor(I)I

    move-result p0

    invoke-virtual {p1, p0}, Landroid/widget/TextView;->setTextColor(I)V

    .line 28
    invoke-static {}, Lcom/estrongs/android/ui/theme/b;->r()Lcom/estrongs/android/ui/theme/b;

    move-result-object p0

    invoke-virtual {p0, v1, v0}, Lcom/estrongs/android/ui/theme/b;->b(II)Landroid/graphics/drawable/Drawable;

    move-result-object p0

    .line 29
    invoke-virtual {p2, p0}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_3

    .line 30
    :cond_3
    invoke-static {}, Lcom/estrongs/android/ui/theme/b;->r()Lcom/estrongs/android/ui/theme/b;

    move-result-object p0

    const v0, 0x7f06032a

    invoke-virtual {p0, v0}, Lcom/estrongs/android/ui/theme/b;->a(I)I

    move-result p0

    invoke-virtual {p1, p0}, Landroid/widget/TextView;->setTextColor(I)V

    .line 31
    invoke-static {}, Lcom/estrongs/android/ui/theme/b;->r()Lcom/estrongs/android/ui/theme/b;

    move-result-object p0

    invoke-virtual {p0, v1}, Lcom/estrongs/android/ui/theme/b;->c(I)Landroid/graphics/drawable/Drawable;

    move-result-object p0

    invoke-virtual {p2, p0}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 32
    :goto_3
    new-instance p0, Ljava/lang/StringBuilder;

    invoke-direct {p0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p0, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    const-string p2, "%"

    invoke-virtual {p0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p0

    invoke-virtual {p1, p0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    return-void

    nop

    :array_0
    .array-data 8
        0x0
        0x0
    .end array-data
.end method
